package com.qf.controller;


import com.qf.dto.LoginDto;
import com.qf.model.Result;
import com.qf.service.ISysUserService;
import com.qf.utils.JwtUtils;
import org.springframework.web.bind.annotation.*;

/**
 * 作者；雷明旭
 * 时间；2021/11/28:52
 * bug退散bug退散bug退散
 */

@RestController
@RequestMapping("/sys-auth")
@CrossOrigin("*")
public class AuthenticationController {
    //这是后台双token校验用到的类
    private ISysUserService sysUserService;
    private JwtUtils jwtUtils;

    public AuthenticationController(ISysUserService sysUserService, JwtUtils jwtUtils) {
        this.sysUserService = sysUserService;
        this.jwtUtils = jwtUtils;
    }

    @PostMapping("/sys-token")
    public Result auth(@RequestBody LoginDto loginDto){
        return sysUserService.SysLogin(loginDto);
    }

}
